<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    html, body, div{
      margin: 0;
      padding: 0;
    }
    .banner{
      position: relative;
      height: 300px;
      overflow: hidden;
    }
    .item{
      position: absolute;
      height: 300px;
      width: 100%;
      left: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 30px;
      color: #fff;
    }
  </style>
</head>
<body>
  <div class="banner">
    <div class="item" style="background: #FFC0CB;">1</div>
    <div class="item" style="background: #4169E1;">2</div>
    <div class="item" style="background: #00FA9A;">3</div>
    <div class="item" style="background: #FFA500;">4</div>
    <div class="item" style="background: #2F4F4F;">5</div>
  </div>
  <script src="./jquery-3.4.1.min.js"></script>
  <script>
    var tickers = [];
    var length = $('.item').length;
    $('.item').each(function(){
      var ele = $(this);
      var index = ele.index('.item')
      ele.css('left', index * 100 + '%')
      move(ele, index);
    })

    function move(ele, index) {
      var ticker = setInterval(function(){
        if(index == -(length-2)){
          ele.css('left', '100%')
          index = 1;
        }
        else{
          ele.animate({left: (index - 1) * 100 + '%'}, 600);
          index--;
        }
      }, 3000);
      tickers.push(ticker);   
    }
  </script>
</body>
</html>